#include "work.h"
#include "peripheral.h"
#include "timer.h"
#include "lpuart.h"
#include "flash.h"
#include "temp.h"
#include "basic.h"
#include "lpm.h"
#include "atim3.h"
#include "my_debug.h"


static uint8_t debug_cnt;
static uint16_t debug_cnt1;

extern boolean_t Debug_Mode;
extern float BAT_Voltage;
extern uint32_t tubu_duty;
extern uint32_t Boost_Duty;
extern float EMS_LOAD_V;
extern boolean_t load_f;

void DEBUG_Handler(void)
{
	if(Debug_Mode==1)
	{
		debug_cnt++;
		if(debug_cnt>25)	
		{
			debug_cnt=0;
		 	// printf("Work_Mode: %d\r\n",Work_Mode);
			// printf("Work_Strength: %d\r\n",Work_Strength);
		 	// printf("BAT_Voltage: %.2f\r\n",BAT_Voltage);
		 	// printf("Ems_Duty: %d\r\n",Ems_Duty);
		 	// printf("Charge_State: %d\r\n",Charge_State);
			printf("EMS_LOAD_V: %.2f load_f: %d\r\n",EMS_LOAD_V,load_f);
			// printf("unit_period: %d duty: %d\r\n",unit_period, unit_duty);
			// printf("repeat: %d phase_time: %d\r\n",repeat_time, phase_time);

			// printf("tubu_duty: [%d], Boost_Duty:[%d] \r\n",tubu_duty, Boost_Duty);
			printf("JW1X_Lingerie \r\n");	//v0.0.6亮度调节
		 	printf("V0.0.1 2025/08/26\r\n");	//v0.0.6亮度调节	
									// jw1_4p v0.0.1
									// V_L 0.0.1 长裤第一版
									//V0.0.2 降低盆底肌电压为原先的40%
									// V0.0.4 长裤 调高 大腿处电压（原先盆底肌位置）
		 	debug_cnt1++;
		 	if(debug_cnt1 > 100)	//10min
		 	{
		 			debug_cnt1=0;
		 			Debug_Mode=0;
		 			printf("Debug Mode OFF\r\n");
		 	}
		}
	}
}
